package com.ra.order.rental;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * 批量转账租金订单记录
 * 
 * @author shen.kang Date: 2015-5-7
 *
 */
@Entity
public class BatchTransRentalRecord {
	
	// 支付宝
	public static final int PAY_TYPE_ALIPAY = 3;
	
	// 微信支付
	public static final int PAY_TYPE_WEIXIN = 0;
	
	// 网银支付
	public static final int PAY_TYPE_BANK = 2;
	
	// 转账中
	public static final int PAY_STATE_PAYING = 0;
	
	// 支付成功
	public static final int PAY_STATE_SUCCESS = 1;
	
	// 支付失败
	public static final int PAY_STATE_FAILURE = 2;
	
	// 服务器异步通知页面路径
	public static final String NOTIFY_URL = "http://www.hhz360.com/ra/order/rental/rentalOrder.requestBatchResult.html";

	// 支付记录ID
	private Integer Id;
	
	// 支付方式3、支付宝 0、微信支付 2、网银支付
	private Integer payType;
	
	// 支付状态1、成功 2失败
	private Integer payState;
	
	// 付款帐号
	private String accountEmail;
	
	// 付款账户名
	private String accountName;
	
	// 付款当天日期(20100801)
	private String payDate;
	
	// 批次号
	private String batchNo;
	
	// 付款总金额
	private BigDecimal batchFee;
	
	// 付款笔数
	private Integer batchNum;
	
	// 租金订单
	private List<RentalOrder> rentalOrders;
	
	// 批量转账记录创建时间
	private Timestamp createTime;
	
	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Id
	@GeneratedValue
	public Integer getId() {
		return Id;
	}

	public void setId(Integer id) {
		Id = id;
	}

	public Integer getPayType() {
		return payType;
	}

	public void setPayType(Integer payType) {
		this.payType = payType;
	}

	public Integer getPayState() {
		return payState;
	}

	public void setPayState(Integer payState) {
		this.payState = payState;
	}

	public String getAccountEmail() {
		return accountEmail;
	}

	public void setAccountEmail(String accountEmail) {
		this.accountEmail = accountEmail;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getPayDate() {
		return payDate;
	}

	public void setPayDate(String payDate) {
		this.payDate = payDate;
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public BigDecimal getBatchFee() {
		return batchFee;
	}

	public void setBatchFee(BigDecimal batchFee) {
		this.batchFee = batchFee;
	}

	public Integer getBatchNum() {
		return batchNum;
	}

	public void setBatchNum(Integer batchNum) {
		this.batchNum = batchNum;
	}

	@OneToMany(targetEntity=RentalOrder.class, fetch=FetchType.LAZY, cascade = CascadeType.PERSIST, mappedBy="batchTransRentalRecord")
	public List<RentalOrder> getRentalOrders() {
		return rentalOrders;
	}

	public void setRentalOrders(List<RentalOrder> rentalOrders) {
		this.rentalOrders = rentalOrders;
	}

}
